from django.db import models
from apps.common.base.models import BaseModel
from apps.merchant.activity.models import Activity
from apps.system.user.models import User

class ActivityPerformance(BaseModel):

    user = models.ForeignKey(User, related_name="user_ActivityPerformance", verbose_name='用户',
                               on_delete=models.SET_NULL, null=True, blank=True, db_constraint=False)
    activity = models.ForeignKey(Activity, related_name="activity_ActivityPerformance", verbose_name='活动',
                               on_delete=models.SET_NULL, null=True, blank=True, db_constraint=False)
    verticalPeopleNumber = models.IntegerField("直推人数", default=0)
    verticalOrderNumber = models.IntegerField("直推单数", default=0)
    verticalPerformance = models.DecimalField("直推业绩", max_digits=10, decimal_places=2, default=0.00)
    teamPeopleNumber = models.IntegerField("团队人数", default=0)
    teamOrderNumber = models.IntegerField("团队单数", default=0)
    teamPerformance = models.DecimalField("团队业绩", max_digits=10, decimal_places=2, default=0.00)

    class Meta:
        verbose_name = 'ActivityPerformance'
        verbose_name_plural = verbose_name
